package demo;

import com.aerospike.client.IAerospikeClient;
import com.aerospike.client.ScanCallback;

public class ScanTest {
	
	
	public static final String NAMESPACE = "ns1";
	public static final String DATASET = "zbdata3";

	public static void main(String[] args) throws Exception {

		IAerospikeClient client = AsClientUtil.getClient();
		System.out.println("client=" + client);


		String namespace = "ns1";
		String dataset = "zbdata3";

		
		System.out.println("scan all,namespace="+namespace+",dataset="+dataset);
		ScanCallback callback = new DefaultScanCallback();
		client.scanAll(null, namespace, dataset, callback, (String)null);
		System.out.println();

		
		/*
		for(Node node:nodes){
			System.out.println("scan node "+node);
			client.scanNode(null, node, NAMESPACE, DATASET, callback, null);
			System.out.println();
		}	
		*/	
		
		
		System.out.println("\n\n\n");
		
        dataset = "dsv3";

		
		System.out.println("scan all,namespace="+namespace+",dataset="+dataset);
		callback = new DefaultScanCallback();
		client.scanAll(null, namespace, dataset, callback, (String)null);
		System.out.println();


		
		
		client.close();
		

		
		
		

	}

}
